package com.inossem.warehousestorage_inossem.activity.storage;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.inossem.utils.listener.NoDoubleClickListener;
import com.inossem.warehousestorage_inossem.R;
import com.inossem.warehousestorage_inossem.activity.base.BaseActivity;
import com.inossem.warehousestorage_inossem.utils.ActivityUtils;
import com.zhy.android.percent.support.PercentRelativeLayout;

public class Storage_ManageActivity extends BaseActivity {

    TextView title;

    private PercentRelativeLayout firstBlock,secondBlock;

    @Override
    protected void onCreateImpl(Bundle savedInstanceState) {
        setContentView(R.layout.activity_storage_manage);
        initView(Storage_ManageActivity.this);
        initData(Storage_ManageActivity.this);
    }

    private void initView(Activity activity) {
        title = (TextView) activity.findViewById(R.id.headerTitle);
        firstBlock = (PercentRelativeLayout) activity.findViewById(R.id.firstBlock);
        secondBlock = (PercentRelativeLayout) activity.findViewById(R.id.secondBlock);
        ActivityUtils.initBackAndFunction(activity, R.string.activity_main_title_short, new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                finish();
            }
        });

        firstBlock.setOnClickListener( new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                Intent intent = new Intent(activity, StorageManageMatrActivity.class);
                activity.startActivity(intent);

            }
        });
        secondBlock.setOnClickListener( new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                Intent intent = new Intent(activity, StorageManagePosiActivity.class);
                activity.startActivity(intent);
            }
        });
    }

    private void initData(Activity activity) {
        title.setText(R.string.activity_storage_manager_title);
    }

}
